Skip to main content

Using Create Eth App

Installation​

You’ll need to have Node 14 or later version on your local development machine (but it’s not required on the server). You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.

You'll also need Yarn on your local development machine. This is because Create Eth App relies on Yarn Workspaces, a feature not supported by Npm.

To quick start development with useDapp run:

yarn create eth-app my-eth-app

It creates folder my-eth-app and inside you have everything created to start.

my-eth-app
β”œβ”€β”€ README.md
β”œβ”€β”€ node_modules
β”œβ”€β”€ package.json
β”œβ”€β”€ .gitignore
└── packages
β”œβ”€β”€ contracts
β”‚ β”œβ”€β”€ README.json
β”‚ β”œβ”€β”€ package.json
β”‚ └── src
β”‚ β”œβ”€β”€ abis
β”‚ β”‚ β”œβ”€β”€ erc20.json
β”‚ β”‚ └── ownable.json
β”‚ β”œβ”€β”€ addresses.js
β”‚ └── index.js
β”œβ”€β”€ react-app
β”‚ β”œβ”€β”€ README.md
β”‚ β”œβ”€β”€ package.json
β”‚ β”œβ”€β”€ node_modules
β”‚ β”œβ”€β”€ public
β”‚ β”‚ β”œβ”€β”€ favicon.ico
β”‚ β”‚ β”œβ”€β”€ index.html
β”‚ β”‚ └── manifest.json
β”‚ └── src
β”‚ β”œβ”€β”€ App.css
β”‚ β”œβ”€β”€ App.js
β”‚ β”œβ”€β”€ App.test.js
β”‚ β”œβ”€β”€ ethereumLogo.svg
β”‚ β”œβ”€β”€ index.css
β”‚ β”œβ”€β”€ index.js
β”‚ β”œβ”€β”€ serviceWorker.js
β”‚ └── setupTests.js
└── subgraph
β”œβ”€β”€ README.md
β”œβ”€β”€ abis
β”‚ └── erc20.json
β”œβ”€β”€ package.json
β”œβ”€β”€ schema.graphql
β”œβ”€β”€ src
β”‚ └── mappings
β”‚ β”œβ”€β”€ tokens.ts
β”‚ └── transfers.ts
└── subgraph.yaml

Start​

Just run:

yarn react-app:start

After that the app starts locally, open http://localhost:3000/ to view it in the browser.

Templates​

Create Eth App comes with a host of decentralized finance templates pre-filled with contract ABIs, addresses and subgraphs. Go to the templates folder, select any framework from the list and see what templates are available.

You can pass the name of the template as the value for the --template command-line argument.

yarn create eth-app my-eth-app --template compound

Philosophy​

  • Minimalistic by design: You are one command away from creating a new Ethereum-powered React app. No intermediary installs, scripts or shims.

  • End-to-End: Create Eth App provides you everything that you need to build and maintain an Ethereum-powered React app at scale, by bringing Yarn Workspaces, Create React App and The Graph under one roof

  • Aimed at Experience Architects: As Kames CG argues in Ethereum Growth's Problem, the Ethereum ecosystem is in a much greater need for top-notch product creators, not smart contract developers. Create Eth App does not enable a smart contract development environment, expecting you to import your own ABIs or build on top of an established protocol like Maker, Compound or Sablier

  • Not Reinventing The Wheel: Under the hood, you use Create React App, one of the most popular and battle-tested frontend development environments.

What's included​

Your environment will have everything you need to build a modern Ethereum-powered single-page React app:

  • Smooth project management via Yarn Workspaces

  • Everything included with Create React App: React, JSX, ES6, TypeScript and Flow syntax support

  • Template subgraph that indexes the events emitted by an ERC-20 contract

  • Minimalist structure for managing the smart contract ABIs and addresses

  • Hassle-free updates for the above tools with a single dependency

Pros​

Create Eth App is a great fit for:

  • Learning how to write Ethereum-powered apps in a comfortable and feature-rich development environment.
  • Starting new Ethereum-powered single-page React applications without wasting time on copy-pasting boilerplates
  • Creating examples with React for your Ethereum-related libraries and components.

Source code​

Source code is available on Github.